/**
 * @Author: 孙小寒
 * @Date: 2020-12-23
 * @Last Modified by: sunxh
 * @Last Modified time: 2020-12-23 14:38
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';


// 列表查询
export const getPartOrderList = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder`, {params})
// 获取车辆数据
export const getVehicleList = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/getVehicleList`, {params})
// ID获取订单详情
export const getPartOrderById = id => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/${id}`)
// 获取订单类型可提报配件列表
export const getOrderPartList = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/getOrderPartList`, {params})
// 获取订单类型控制信息
export const getPartOrderTypeInfo = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/getPartOrderTypeInfo`, {params})
// 查询特殊追溯订单唯一标识字段是否重复
export const getValidRepeat = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/validRepeat`, {params})
// 保存
export const postSavePartOrder = params => axios.post(`${SERVER.CMSCLOUD_WMS}/part/partOrder`, params)
// 批量导入数据验证
export const postValidImportData = params => axios.post(`${SERVER.CMSCLOUD_WMS}/part/partOrder/validImportData`, params)
// 批量保存订单
export const postImportPartOrders = params => axios.post(`${SERVER.CMSCLOUD_WMS}/part/partOrder/imports`, params)
// 根据id更新订单状态
export const postUpdateStatus = params => axios.post(`${SERVER.CMSCLOUD_WMS}/part/partOrder/updateStatus`, params)
// 修改
export const putPartOrder = params => axios.put(`${SERVER.CMSCLOUD_WMS}/part/partOrder`, params);
// 根据vin码查询车辆数据（不分页）
export const selectVehicleBySecurityCodePO = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/selectVehicleBySecurityCodePO`, {params})
// BO订单查询
export const getBOOrderList = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrderDetail`, {params})
// 经销商B/O订单状态变更
export const postBOCancelApply = (id,flag) => axios.post(`${SERVER.CMSCLOUD_WMS}/part/partOrderDetail/cancelApply/${id}/${flag}`)
// 修改BO订单计划到货时间
export const putUpdateYJDHSJ = params => axios.put(`${SERVER.CMSCLOUD_WMS}/part/partOrderDetail/updateYJDHSJ`, params);
// 修改BO订单计划到货时间
export const applyBoClose = params => axios.put(`${SERVER.CMSCLOUD_WMS}/part/partOrderDetail/applyBoClose`, params);
// 计划到货时间批量导入
export const putImportYJDHSJ = params => axios.put(`${SERVER.CMSCLOUD_WMS}/part/partOrderDetail/importYJDHSJ`, params);
// 查询当前配件促销活动
export const getSalesAgreementList = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/salesAgreement/getList`, {params})
// 查询所有销售车辆
export const getCar = params => axios.get(`${SERVER.RETAIL}/saleAfterInter/getVehilceOwnerDataForHtml`,  { params }  );
// 特殊追溯订单
export const getSpecialPartOrder = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/getspecialpartorder`, {params})
// 销售流水列表
export const getOrderAccount = params => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partOrder/orderAccount`, {params});